require('../global')
require('../server/mongodb')

var server = new org.jsmud.db.Mongo('127.0.0.1', 27017, 'test');
var room = server.getDb('room');
room.save({name:'Testing'}, function(results, session){
	console.log(results);
	session.find({}, function(items){
		console.log(_('found : ${items.length}', {items:items}))
	});
	session.find({example:{name:'Testing'}}, function(items){
		console.log(items);
		session.remove({_id:results._id}, function(items){
			console.log('Remove: ' + items);
			session.remove({name:'Testing'}, function(){
				console.log('Removed');
			})
		})
	})
})
